package com.book.bigwork.repository;

import com.book.bigwork.model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BookRepository extends JpaRepository<Book, Long> {
    @Query("select p from Book p where p.bookName like ?1 or p.bookAuthor like ?1")
    List<Book> searchBooks(String query);
    @Query("select p from Book p where p.bookIsbn like ?1")
    Book searchByIsbn(String query);
}